#pragma once
#include <QThread>
#include <QDebug>
#include "stepper.h"

#ifdef ARM32
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <unistd.h>
  #include <errno.h>
  #include <fcntl.h>
  #include <dirent.h>
  #include <linux/input.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <sys/select.h>
  #include <sys/time.h>
  #include <termios.h>
  #include <signal.h>
#endif

class CKeyboard : public QThread
{
  Q_OBJECT
public:
  CKeyboard();

signals:
  void keySignal(int keycode);

private:
  int fd, rd, value, datasize;
#ifdef ARM32
  struct input_event ev[64];
#endif
  void run();
  void exec();
};

extern CKeyboard k;
